<ul class="nav nav-stacked">	


	<?php
		session_start();
		$con = mysql_connect("localhost", "group5", "group5");
		if(!$con)
		{
			echo "Connection failed!";
			exit;
		}
	
	
	
				mysql_select_db("group5");
				
				
	
				
				if(isset($_SESSION['userId']))
				{
				
				$userId = $_SESSION['userId'];
				$query = mysql_query("select * from USERS where userId = $userId", $con);
				$getRow = mysql_fetch_row($query);
		
				$userRoleId = $getRow[4];
		
				//If only a normal user, don't allow them to view the manage session tools.
				if($userRoleId == 6 )
				{
				echo "<li><a href='index.php'>Home</a></li>
				<li><a href='registerShopPage.php'>Browse Workshops</a></li>
				<li><a href='viewSessions.php'>Registered Sessions</a></li>
				<li><a href='logout.php'>Log Out</a></li></ul>";
				}
				//If the user is an admin, let them see the Manage/Create page.
				else if($userRoleId == 5)
				{
				echo "<li><a href='index.php'>Home</a></li>
				<li><a href='registerShopPage.php'>Browse Workshops</a></li>
				<li><a href='viewSessions.php'>Registered Sessions</a></li>
				<li><a href='viewattendance.php'>Sessions Report</a></li>
				<li><a href='logout.php'>Log Out</a></li>
				</ul>
				<h4>Admin Tools:</h4>
				<ul class='nav nav-stacked'>
				<li><a href='adminCreate.php'>Create Session</a></li>
				<li><a href='adminManage.php'>View/Edit My Sessions</a></li>
				<li><a href='addRoom.php'>Add New Room</a></li>
				<li><a href='addWorkshop.php'>Add New Workshop</a></li></ul>";
			
				}elseif($userRoleId == 7){
             echo "<li><a href='index.php'>Home</a></li>
				<li><a href='registerShopPage.php'>Browse Workshops</a></li>
				<li><a href='viewSessions.php'>Registered Sessions</a></li>
				<li><a href='logout.php'>Log Out</a></li>
				</ul>
				<h4>Instructor Sessions:</h4>
				<ul class='nav nav-stacked'>
         <li><a href='instructor_sessions.php'>Teaching Sessions</a></li>
          <li><a href='viewattedance.php'>Sessions Report</a></li></ul>";
            }
			}
			else
			{
				echo "<li><a href='index.php'>Home</a></li>
						<li><a href='loginpage.php'>Log In</a></li>
						<li><a href='registerPage.php'>Sign Up</a></li></ul>";
			}
	
	?>
	
	
